//
//  MKThirdTableViewCell.m
//  ManKeCartoon
//
//  Created by dllo on 15/10/16.
//  Copyright © 2015年 ManKe. All rights reserved.
//

#import "MKThirdTableViewCell.h"
#import "MKBaseHeader.h"
@implementation MKThirdTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        //self.myMUtableArray = [[NSMutableArray alloc] init];
        
        //self.myMUtableArray = bigArray;
        
        //FirstModels *model = [[FirstModels alloc] init];
        //model = [self.myMUtableArray[index] objectAtIndex:row];
        
        self.upLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, .5)];
        [self.upLine setBackgroundColor:[UIColor grayColor]];
        [self.contentView addSubview:self.upLine];
        
        self.topImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, self.upLine.frame.origin.y + 10, SCREEN_WIDTH / 3, SCREEN_HEIGHT / 7 - 20)];
        //[self.topImage sd_setImageWithURL:[NSURL URLWithString:model.cover_url]];
        [self.contentView addSubview:self.topImage];
        
        self.numLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.topImage.frame.size.width + 20, self.topImage.frame.origin.y + 5, 30, 30)];
        //[self.numLabel setText:[NSString stringWithFormat:@"0%ld",row + 1]];
//        if (row == 0) {
//            [self.numLabel setTextColor:[UIColor redColor]];
//        }else if (row == 1){
//            [self.numLabel setTextColor:[UIColor orangeColor]];
//        }else if (row == 2){
//            [self.numLabel setTextColor:[UIColor blueColor]];
//        }else if (row == 3){
//            [self.numLabel setTextColor:[UIColor grayColor]];
//        }else if (row == 4){
//            [self.numLabel setTextColor:[UIColor grayColor]];
//        }
        [self.numLabel setFont:[UIFont boldSystemFontOfSize:20]];
        [self.contentView addSubview:self.numLabel];
        
        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.topImage.frame.size.width + 50, self.topImage.frame.origin.y , SCREEN_WIDTH / 2, 30)];
        //[self.titleLabel setText:model.title];
        [self.titleLabel setFont:[UIFont systemFontOfSize:15]];
        [self.titleLabel setTextColor:[UIColor blackColor]];
        [self.contentView addSubview:self.titleLabel];
        
        self.typeLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.titleLabel.frame.origin.x, self.titleLabel.frame.origin.y + 25, SCREEN_WIDTH / 2, 20)];
//        [self.typeLabel setText:model.type];
        [self.typeLabel setTextColor:[UIColor grayColor]];
        [self.typeLabel setFont:[UIFont systemFontOfSize:14]];
        [self.contentView addSubview:self.typeLabel];
        
        self.rqLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 70, self.topImage.frame.origin.y + self.topImage.frame.size.height - 20, 70, 20)];
        [self.rqLabel setTextColor:[UIColor redColor]];
        [self.rqLabel setFont:[UIFont systemFontOfSize:12]];
        //[self.rqLabel setText:[NSString stringWithFormat:@"热度:%@",model.hot_degree]];
        [self.contentView addSubview:self.rqLabel];
        
        self.topButton = [UIButton buttonWithType:UIButtonTypeCustom];

        [self.topButton setFrame:CGRectMake(0, self.titleLabel.frame.origin.y, SCREEN_WIDTH, self.topImage.frame.size.height)];
        [self.contentView addSubview:self.topButton];
        //[self.topButton setBackgroundColor:[UIColor redColor]];
        
    }

    return self;
}

- (void)getDataWithModel:(MKFirstModel *)firstModel{
    
    
    [self.topImage sd_setImageWithURL:[NSURL URLWithString:firstModel.cover_url]];
    [self.titleLabel setText:firstModel.title];
    [self.typeLabel setText:firstModel.type];
    [self.rqLabel setText:[NSString stringWithFormat:@"热度:%@",firstModel.hot_degree]];
    
    
}










- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
